<?php
namespace app\admin\model\user;

use app\common\traits\ModelCurd;
use think\Model;

class User extends Model
{
    protected $table='cp_admin';
    protected $autoWriteTimestamp = true;
    protected $auto = ['is_admin'];
    use ModelCurd;
    public function setIsAdminAttr($value)
    {
        if($value) return $value;
        return 0;
    }

    public function getAvatarAttr($value)
    {
        return _get_image_preview_url($value);
    }
}